<template>
    <div style="margin-bottom: 10px">
           <el-card shadow="hover">
            <el-row class="art-title">
              <router-link :to="{name:'article',query:{id:article.atcId}}" tag="span" >{{article.title}}</router-link>
            </el-row>
            <el-row class="art-info d-flex align-items-center justify-content-start">
                <div class="art-time">
                <i class="el-icon-time">：</i>
                <span style="font-size:14px">{{article.createTime}}</span>
              </div>
              <div class="d-flex align-items-center">
                <i class="el-icon-caret-right"></i>
                <el-tag size="mini">{{article.topicName}}</el-tag>
              </div>
            </el-row>
            <el-row class="art-body" v-if="article.cover">
              <div class="side-img hidden-sm-and-down">
                <img class="art-banner" :src="article.cover"  v-if="article.cover"/>
                <img class="art-banner" src="http://resource.teemor.xyz/1584956816644"  v-else/>
              </div>
              <div class="side-abstract">
                <div class="art-abstract">{{article.summary}}</div>
                <div class="art-more">
                  <router-link :to="{name:'article',query:{id:article.atcId}}" tag="span">
                    <el-button plain>{{$t('home.readMore')}}</el-button>
                  </router-link>
                  <div class="view">
                    <!-- <i class="el-icon-view"></i>12414 -->
                  </div>
                </div>
              </div>
            </el-row>
          </el-card>
    </div>
</template>

<script>
export default {
    props: ['article'],
    data() {
        return {
            data: this.article
        }

    },
     watch: {
    // 监听父组件传入的数据，更新到本地
    article(newVal, oldVal) {
      this.data = newVal
    }
  },
}
</script>

<style scoped>
.art-item {
  margin-bottom: 30px;
  position: relative;
}

.art-item .star {
  width: 60px;
  height: 60px;
  position: absolute;
  top: 0;
  right: 0;
}

img.tag {
  width: 16px;
  height: 16px;
}

.art-title {
  /* border-left: 3px solid #f56c6c; */
  margin: 10px 0;
  padding-left: 5px;
  font-weight: bold;
  cursor: pointer;
}

.art-title:hover {
  padding-left: 10px;
  color: #409eff;
}

.art-time {
  margin-right: 20px;
  margin-bottom: 10px !important;
}

.art-body {
  display: flex;
  padding: 10px 0;
}

.side-img {
  height: 150px;
  width: 270px;
  overflow: hidden;
  margin-right: 10px;
}

img.art-banner {
  width: 100%;
  height: 100%;
  transition: all 0.6s;
}

img.art-banner:hover {
  transform: scale(1.4);
}

.side-abstract {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.art-abstract {
  flex: 1;
  color: #aaa;
}

.art-more {
  height: 40px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.art-more .view {
  color: #aaa;
}

h5 {
  font-size: 18px;
}

.pagination {
  background-color: #f9f9f9;
}
</style>